﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="WeightLossProject._Default" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <h2 class=custom-header>Welcome to the Weight Loss Project!
        <asp:ImageButton ID="ImageButton1" 
            runat="server" ImageAlign="Right" ImageUrl="images/rss.png" 
            PostBackUrl="rss/feed.aspx" Width="20px" />&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:HyperLink ID="HyperLink1" runat="server" Target="rss/feed.aspx" 
            ForeColor="#FF6600" NavigateUrl="rss/feed.aspx">RSS Feed!</asp:HyperLink>
    </h2>


    <asp:SqlDataSource ID="dsTagsByWeight" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [TagsByWeight]"></asp:SqlDataSource>

    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
<div style="height:150px; display:block; clear:both;">
<div style="float:left; width:395px; height:130px; background-image:#ededed; margin:5px; padding:10px; overflow-y:scroll; border:1px dashed #ddd;">
    <h2 class="custom-header1">Tags</h2>
    <asp:Label ID="CloudMarkup" runat="server" CssClass="frmDisplay"></asp:Label>
</div>
<div style="float:right; width:200px; height:130px; background-image: url(images/test.jpg); background-repeat:no-repeat; margin:5px; padding:10px; border:1px solid #ddd;">
<h2 class="custom-header1">Newest Members. <a href="Account/Register.aspx">Join Now!</a></h2>
    <div style="text-align:center;">
    <asp:Image ID="Image1" runat="server" Height="50px" Width="50px" 
            style="border: 1px solid #000; padding:3px;" BackColor="White"/>
    <asp:Label ID="lblTitle" runat="server" Font-Bold="True" BackColor="#aadadc" 
            ForeColor="Black" ></asp:Label>
    <br/>
    <asp:Button ID="btnPrev" runat="server" Text="Prev" BackColor="#465564" Font-Names="Arial" BorderWidth="0px" ForeColor="#FFFFFF" Width="60px" />
    <asp:Button ID="btnPlay" runat="server" Text="Play" BackColor="#465564" Font-Names="Arial" BorderWidth="0px" ForeColor="#FFFFFF" Width="60px" />
    <asp:Button ID="btnNext" runat="server" Text="Next" BackColor="#465564" Font-Names="Arial" BorderWidth="0px" ForeColor="#FFFFFF" Width="60px" />            
    </div>  

        <asp:SlideShowExtender ID="slideshowNewMembers" runat="server"
            TargetControlID="Image1"
            SlideShowServicePath="SlideService.asmx"
            SlideShowServiceMethod="GetSlides "
            AutoPlay="true"
            NextButtonID="btnNext"
            PreviousButtonID="btnPrev"
            PlayButtonID="btnPlay"
            ImageDescriptionLabelID="lblDescription"
            ContextKey="123"
            Loop="true" Enabled="True" ImageTitleLabelID="lblTitle" 
        PlayButtonText="Play" StopButtonText="Stop" PlayInterval="3500">
        </asp:SlideShowExtender>
            
</div>

</div>
<br/>

<h2 class="custom-header">Latest Weight-Loss Progress Updates!</h2>

        <asp:GridView ID="GridView1" runat="server" DataSourceID="dsWeightLossProject" 
            AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="ID" ForeColor="Black" GridLines="Horizontal" 
            PageSize="5" Width="660px" BackColor="White" BorderColor="#CCCCCC" 
            BorderStyle="None" BorderWidth="1px">
            <Columns>
                <asp:TemplateField HeaderText="Progress Picture">
                <ItemTemplate>
                    <a href = "ProgressPage.aspx?PID=<%# Eval("ID") %>"><img src="<%# Eval("Picture") %>"  width="100px" /></a>
                </ItemTemplate>
                    <ControlStyle CssClass="progressPic" Height="100px" Width="100px" />
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="Title" 
                    SortExpression="Title" >
                <ControlStyle Width="200px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Description">
                    <ItemTemplate>
                    <a href = "ProgressPage.aspx?PID=<%# Eval("ID") %>">
                        <%# Eval("Description").ToString().Substring(0, 70) + " ...."%> 
                    </a>
                   </ItemTemplate>

                </asp:TemplateField>

                <asp:TemplateField HeaderText="Member">
                    <ItemTemplate>
                    <a href = "ProfilePage.aspx?UID=<%# Eval("UserID") %>">
                        <%# Eval("UserName")%> 
                    </a>
                   </ItemTemplate>
                </asp:TemplateField>


                <asp:BoundField DataField="Weight" HeaderText="Weight" 
                    SortExpression="Weight" />
                <asp:BoundField DataField="EntryDate" HeaderText="Date" 
                    SortExpression="EntryDate" >
                <ControlStyle Font-Size="Small" />
                </asp:BoundField>
                <asp:BoundField DataField="CommentsCount" HeaderImageUrl="images/comment.png" 
                    HeaderText="Comments" />
            </Columns>
            <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
            <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F7F7F7" />
            <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
            <SortedDescendingCellStyle BackColor="#E5E5E5" />
            <SortedDescendingHeaderStyle BackColor="#242121" />
        </asp:GridView>
        <asp:SqlDataSource ID="dsWeightLossProject" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            CancelSelectOnNullParameter="False" >
            
            
            <SelectParameters>
                <asp:QueryStringParameter Name="Tag" QueryStringField="Tag" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>


    <p>
        <asp:TextBox ID="txtSearch" runat="server" CssClass="frminput"></asp:TextBox>
         <asp:RequiredFieldValidator ID="rfv_txtSearch" runat="server" 
             ControlToValidate="txtSearch" Display="Dynamic" 
             ErrorMessage="You have to enter a Search Term!"></asp:RequiredFieldValidator>
        <asp:Button ID="btnSearch" runat="server" 
             Text="Search for User Profiles by Name!" CssClass="frminput" />
    </p>


    </asp:Content>
